import { createRouter, createWebHistory } from 'vue-router'
import MainLayout from '@/layouts/MainLayout.vue'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      component: MainLayout,
      redirect: '/config',
      children: [
        {
          path: '/config',
          name: 'Config',
          component: () => import('@/views/ConfigView.vue'),
          meta: { title: '任务配置', icon: '⚙️' }
        },
        {
          path: '/monitor',
          name: 'Monitor',
          component: () => import('@/views/MonitorView.vue'),
          meta: { title: '实时监控', icon: '📊' }
        },
        {
          path: '/data',
          name: 'Data',
          component: () => import('@/views/DataView.vue'),
          meta: { title: '数据管理', icon: '💾' }
        },
        {
          path: '/viewer',
          name: 'Viewer',
          component: () => import('@/views/ViewerView.vue'),
          meta: { title: '数据查看', icon: '🔍' }
        },
        {
          path: '/logs',
          name: 'Logs',
          component: () => import('@/views/LogsView.vue'),
          meta: { title: '系统日志', icon: '📝' }
        },
        {
          path: '/stats',
          name: 'Stats',
          component: () => import('@/views/StatsView.vue'),
          meta: { title: '数据统计', icon: '📈' }
        },
        {
          path: '/settings',
          name: 'Settings',
          component: () => import('@/views/SettingsView.vue'),
          meta: { title: '系统设置', icon: '🔧' }
        }
      ]
    }
  ]
})

export default router